/*
 Navicat Premium Data Transfer

 Source Server         : mysql
 Source Server Type    : MySQL
 Source Server Version : 80027
 Source Host           : localhost:3306
 Source Schema         : kdc_db

 Target Server Type    : MySQL
 Target Server Version : 80027
 File Encoding         : 65001

 Date: 20/01/2022 11:45:03
*/

SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;

-- ----------------------------
-- Table structure for car_brand
-- ----------------------------
DROP TABLE IF EXISTS `car_brand`;
CREATE TABLE `car_brand` (
  `brand_id` int NOT NULL,
  `brand_name` varchar(255) NOT NULL,
  PRIMARY KEY (`brand_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;

-- ----------------------------
-- Records of car_brand
-- ----------------------------
BEGIN;
INSERT INTO `car_brand` (`brand_id`, `brand_name`) VALUES (1, '奥迪');
INSERT INTO `car_brand` (`brand_id`, `brand_name`) VALUES (2, '宝马');
INSERT INTO `car_brand` (`brand_id`, `brand_name`) VALUES (3, '奔驰');
INSERT INTO `car_brand` (`brand_id`, `brand_name`) VALUES (4, '大众');
INSERT INTO `car_brand` (`brand_id`, `brand_name`) VALUES (5, '现代');
INSERT INTO `car_brand` (`brand_id`, `brand_name`) VALUES (6, '长城');
INSERT INTO `car_brand` (`brand_id`, `brand_name`) VALUES (7, '红旗');
INSERT INTO `car_brand` (`brand_id`, `brand_name`) VALUES (8, '长安');
COMMIT;

-- ----------------------------
-- Table structure for car_model
-- ----------------------------
DROP TABLE IF EXISTS `car_model`;
CREATE TABLE `car_model` (
  `model_id` int NOT NULL,
  `model_name` varchar(255) NOT NULL,
  `model_photo` varchar(255) DEFAULT NULL,
  `brand_id` int NOT NULL,
  PRIMARY KEY (`model_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;

-- ----------------------------
-- Records of car_model
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for car_photo
-- ----------------------------
DROP TABLE IF EXISTS `car_photo`;
CREATE TABLE `car_photo` (
  `photo_id` int NOT NULL,
  `photo_name` varchar(255) NOT NULL,
  `photo_path` varchar(255) DEFAULT NULL,
  `car_id` int NOT NULL,
  PRIMARY KEY (`photo_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;

-- ----------------------------
-- Records of car_photo
-- ----------------------------
BEGIN;
INSERT INTO `car_photo` (`photo_id`, `photo_name`, `photo_path`, `car_id`) VALUES (1, '蓝色照片1', 'http://xxxxx.png', 1);
INSERT INTO `car_photo` (`photo_id`, `photo_name`, `photo_path`, `car_id`) VALUES (2, '蓝色照片2', 'http://xxxxx.png', 1);
COMMIT;

-- ----------------------------
-- Table structure for car_type
-- ----------------------------
DROP TABLE IF EXISTS `car_type`;
CREATE TABLE `car_type` (
  `type_id` int NOT NULL,
  `type_name` varchar(255) NOT NULL,
  PRIMARY KEY (`type_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;

-- ----------------------------
-- Records of car_type
-- ----------------------------
BEGIN;
INSERT INTO `car_type` (`type_id`, `type_name`) VALUES (1, '经济型');
INSERT INTO `car_type` (`type_id`, `type_name`) VALUES (2, '舒适型');
INSERT INTO `car_type` (`type_id`, `type_name`) VALUES (3, '精英型');
INSERT INTO `car_type` (`type_id`, `type_name`) VALUES (4, 'SUV');
INSERT INTO `car_type` (`type_id`, `type_name`) VALUES (5, '5-15座商务');
INSERT INTO `car_type` (`type_id`, `type_name`) VALUES (6, '电动型');
INSERT INTO `car_type` (`type_id`, `type_name`) VALUES (7, '高端车');
COMMIT;

-- ----------------------------
-- Table structure for stock_car
-- ----------------------------
DROP TABLE IF EXISTS `stock_car`;
CREATE TABLE `stock_car` (
  `stock_id` int NOT NULL AUTO_INCREMENT,
  `brand_id` int DEFAULT '-1',
  `brand_name` char(50) DEFAULT NULL,
  `model_id` int DEFAULT NULL,
  `model_name` char(50) DEFAULT NULL,
  `model_photo` varchar(255) DEFAULT NULL,
  `info_id` int NOT NULL DEFAULT '-1',
  `car_color` varchar(255) DEFAULT NULL,
  `plate_number` varchar(255) DEFAULT NULL,
  `car_type` int NOT NULL DEFAULT '0',
  `car_status` int NOT NULL DEFAULT '0',
  `stock_status` int NOT NULL DEFAULT '0',
  `start_shop` int NOT NULL DEFAULT '-1',
  `end_shop` int NOT NULL DEFAULT '-1',
  `stock_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`stock_id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb3;

-- ----------------------------
-- Records of stock_car
-- ----------------------------
BEGIN;
INSERT INTO `stock_car` (`stock_id`, `brand_id`, `brand_name`, `model_id`, `model_name`, `model_photo`, `info_id`, `car_color`, `plate_number`, `car_type`, `car_status`, `stock_status`, `start_shop`, `end_shop`, `stock_time`) VALUES (1, 1, '奥迪', 1, '奥迪A4L', '', 1, '#fff', '', 0, 0, 0, -1, -1, '2022-01-19 16:47:25');
INSERT INTO `stock_car` (`stock_id`, `brand_id`, `brand_name`, `model_id`, `model_name`, `model_photo`, `info_id`, `car_color`, `plate_number`, `car_type`, `car_status`, `stock_status`, `start_shop`, `end_shop`, `stock_time`) VALUES (2, 1, '奥迪', 1, '奥迪A4L', '', 1, '#fff', '', 0, 0, 0, -1, -1, '2022-01-19 16:48:27');
COMMIT;

-- ----------------------------
-- Table structure for user_info
-- ----------------------------
DROP TABLE IF EXISTS `user_info`;
CREATE TABLE `user_info` (
  `user_id` int NOT NULL AUTO_INCREMENT,
  `user_nick` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '用户昵称',
  `user_avatar` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
  `user_phone` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
  `user_password` varchar(255) NOT NULL DEFAULT '',
  `user_vip_level` int NOT NULL DEFAULT '0',
  `user_integral` int NOT NULL DEFAULT '0',
  `user_disable` int NOT NULL DEFAULT '0' COMMENT '0 正常使用 1 禁用 2注销',
  `register_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`user_id`)
) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=utf8mb3;

-- ----------------------------
-- Records of user_info
-- ----------------------------
BEGIN;
INSERT INTO `user_info` (`user_id`, `user_nick`, `user_avatar`, `user_phone`, `user_password`, `user_vip_level`, `user_integral`, `user_disable`, `register_time`) VALUES (7, '徐勇江', 'http://xxxx.png', '15810551131', '1234567', 0, 0, 0, '2022-01-19 16:36:08');
INSERT INTO `user_info` (`user_id`, `user_nick`, `user_avatar`, `user_phone`, `user_password`, `user_vip_level`, `user_integral`, `user_disable`, `register_time`) VALUES (8, '苏晓莉', 'http://xxxx.png', '18032741480', '1234567', 0, 0, 0, '2022-01-19 16:36:08');
COMMIT;

SET FOREIGN_KEY_CHECKS = 1;
